<template name="components">
    <view class="content">
        <tui-loading></tui-loading>
        <!-- <image class="logo" src="https://cdn1.sanyedu.com/static/img/loading.gif" mode="aspectFill"></image>
        <view class="text-area">
            <text class="title">加载中</text>
        </view> -->
    </view>
</template>

<script>
import cfg from '@/common/config.js'
    export default {
        components: {

        },
        data() {
            return {

            };
        },
        computed: {},
        onShow() {
            var t = this
            uni.request({
                url: cfg.adminurl + '/infra/config/get-value-by-key?key=uniapp.config',
                method: 'GET',
                header: {
                    'tenant-id': '1',  // 设置请求头
                },
                success: (res) => {
                    console.log(res);

                    var switchCfg = JSON.parse(res.data.data)
                    this.f.storage('switchCfg',switchCfg)

                    console.log('请求成功',res.data.data);
                },
                fail: (err) => {
                    console.log('请求失败',err);
                }
            });

            // this.$api.req(
            //     '/infra/config/get-value-by-key?key=uniapp.config',
            //     {},
            //     'get',
            //     'JSON',
            //     false
            // ).then((res) => {
            //     if (res.code === 0) {
            //         this.user = res.data;
            //     }
            // });
            var token = t.$cfg.token()
            setTimeout(() => {
                t.f.nav('/pages/index/index','tab')
            },1000);
            // if (t.f.isnull(token) == '') {
            //     setTimeout(() => {
            //         t.f.nav('/pages/login/login','M')
            //     },1000);

            // } else {
            //     setTimeout(() => {
            //         t.f.nav('/pages/index/index','M')
            //     },1000);
            // }
        },
        onHide() {
        },
        mounted() {

        },
        methods: {}
    }
</script>

<style>
    page {
        height: 100%;
        width: 100%;
    }

    .content {
        background-color: #fff;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        /* justify-content: center; */
    }

    .logo {
        height: 80rpx;
        width: 80rpx;
        margin-top: 200rpx;
        margin-left: auto;
        margin-right: auto;
        opacity: 1;
        /* margin-bottom: 50rpx; */
    }

    .text-area {
        display: flex;
        justify-content: center;
    }

    .title {
        color: #000;
        font-size: 18px;
        padding-top: 10px;
    }
</style>